package com.rimi.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
@Data
@ApiModel("处方类")
public class PrescriptionListDto {

    @ApiModelProperty("处方单号")
    private Integer prescriptionId;

    @ApiModelProperty("医生名字")
    private String doctorNickname;

    @ApiModelProperty("就诊时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date appointmentTime;

    @ApiModelProperty("取药时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date prescriptionDate;

    @ApiModelProperty("宠物名称")
    private String petNickname;

    @ApiModelProperty("宠物编号")
    private Integer petsId;

    @ApiModelProperty("医生诊断")
    private String doctorDiagnosis;

    @ApiModelProperty("取药状态：1表示已取药，0表示未取药")
    private String visitStatus;

    @ApiModelProperty("药品名称")
    private String medicinalName;

    @ApiModelProperty("药品数量")
    private Integer medicinalNum;

    @ApiModelProperty("药品单价")
    private Double medicinalMoney;

    @ApiModelProperty("药品总价（指一种药的总价）")
    private Double price;

    @ApiModelProperty("药品费用（指所有药品的总价）")
    private Double allPrice;

    public double getPrice(){
        if(medicinalNum != null){
            price = medicinalNum * medicinalMoney;
            return price;
        }
        return 0;
    }

}
